import QtQuick
import QtQuick.Controls

Item {
    id: control
    property bool checked : false
    property string text : "Text"
    width: 105
    height: 32
    state: "normal"
    FontLoader{
        id: boldFont
        source:"fonts/SourceHanSansCN-Bold.otf"
    }
    states: [
        State {
            name: "normal"
            when: !control.checked
            PropertyChanges {
                backgroundImage{
                    source : "images/tab-title-normal.png"
                }
                textShow{
                    color:"#CEDCE6"
                }
            }
        },
        State{
            name: "checked"
            when: control.checked
            PropertyChanges {
                backgroundImage{
                    source: "images/tab-title-hovered.png"
                }
                textShow{
                    color:"#ffffff"
                }
            }
        }

    ]
    Image {
        id: backgroundImage
        anchors.fill: parent
        source: "images/tab-title-normal.png"
    }

    Text {
        id: textShow
        color: "#ffffff"
        text: control.text
        anchors.fill: parent
        font.pixelSize: 16
        font.family: boldFont.name
        horizontalAlignment: Text.AlignHCenter
        verticalAlignment: Text.AlignVCenter
        leftPadding: 40
    }
}
